<template>
  <div class="debounceWrapper">
    <span>输入数据：</span>
    <Input v-model="value"
           placeholder="输入value"
           style="width: 300px"
           @on-keyup="appSearch" />
    <p>将值显示在这里： {{ value }}</p>
    <div>防抖处理后 值的显示 delaydata: {{ delayData }}</div>
  </div>
</template>

<script>
import { debounce } from "@/utils/common.js";

export default {
  data () {
    return {
      value: "",
      delayData: ""
    };
  },
  methods: {
    getList () {
      this.delayData = this.value;
    },
    appSearch: debounce(
      function () {
        this.getList();
      },
      300,
      false
    )
  }
};
</script>

<style scoped></style>
